import { OnInit, Component, ViewChild } from '@angular/core';
import { SystemFileListComponent } from './system-file-list.component';

@Component({
  selector: 'app-system-file-view',
  templateUrl: './system-file-view.component.html',
  styles: [],
})
export class SystemFileViewComponent implements OnInit {
  constructor() {}

  @ViewChild('systemFileListComponent', { static: false })
  systemFileListComponent: SystemFileListComponent;

  /**
   * 条件查询参数
   */
  queryParams = {
    originalName: null,
    type: null,
  };

  /**
   * 查找字典
   */
  onSearch() {
    this.systemFileListComponent.loadData();
  }

  /**
   * 重置表单
   */
  onResetForm() {
    this.queryParams.originalName = '';
    this.queryParams.type = '';
  }

  /**
   * 上传文件
   */
  create() {
    this.systemFileListComponent.uploadAttach('测试文件', null);
  }

  /**
   * 刷新
   */
  reflesh() {
    this.systemFileListComponent.loadData();
  }

  ngOnInit() {}
}
